﻿using S_Userinfor.Domains;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace S_Gridding.Infrastructure.Dapper
{
    /// <summary>
    /// Dapper的底层仓储接口
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public interface IDapperRepository<T>
    {
        /// <summary>
        /// 显示+分页
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="selectSql"></param>
        /// <returns></returns>
        Task<List<T>> SelectAsync(int PageSize, string selectSql);

        /// <summary>
        /// 反填
        /// </summary>
        /// <param name="Id"></param>
        /// <param name="selectOneSql"></param>
        /// <returns></returns>
        Task<T> GetOne(int Id, string selectOneSql);

        /// <summary>
        /// 树形
        /// </summary>
        /// <param name="pid"></param>
        /// <param name="selectTreeSql"></param>
        /// <returns></returns>
        Task<List<T>> GetTree(int pid, string selectTreeSql);
    }
}
